Input Device

ABSTRACT

In accordance with an aspect of the present invention, an input device includes: a state detection portion to detect a state of a connected external device; a signal generation portion to generate a pulse signal predetermined for the detected state; a signal detection portion responsive to detection of a pulse signal to output a state signal predetermined for the detected pulse signal; and an opening/closing portion to open/close a circuit that connects the signal generation portion with the signal detection portion.

This application is based on Japanese Patent Application No. 2009-248518filed with Japan Patent Office on Oct. 29, 2009, the entire content ofwhich is hereby incorporated by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an input device, and more particularlyto an input device suitable for electronic equipment having operationkeys small in number.

2. Description of the Related Art

Conventional electronic equipment contains a microcomputer to allocate asingle key among a plurality of processes. The microcomputer allowsswitchover among a plurality of states and determines a process to beexecuted in accordance with a combination of the selected state and thepressed key. Therefore, the microcomputer cannot determine a process tobe executed unless the state selected when a key is pressed is notidentified.

For example, a conventionally known key input device includes a keymatrix portion including an ID code generating circuit, and a codeconversion portion. The code conversion portion performs key-scan on thekey matrix portion using an X bus for strobe signal output and a Y busfor key address input. The code conversion portion takes in an ID codefrom the Y bus through an ID code identifying portion. In this key inputdevice, an ID code is set by using a particular signal output from the Xbus initially or at the start of key-scan to temporarily clamp aparticular line of the Y bus at a prescribed logic level.

The conventional key input device outputs the ID code to the Y businitially or at the start of key-scan and therefore cannot perform IDcode setting and key-scan simultaneously. Thus, the ID code has to beset every time the microcomputer of the electronic equipment changesstates. Accordingly, a prescribed time is required before key-scan isstarted.

SUMMARY OF THE INVENTION

In accordance with an aspect of the present invention, an input deviceincludes: a state detection portion to detect a state of a connectedexternal device; a signal generation portion to generate a pulse signalpredetermined for the detected state; a signal detection portionresponsive to detection of a pulse signal to output a state signalpredetermined for the detected pulse signal; and an opening/closingportion to open/close a circuit that connects the signal generationportion with the signal detection portion.

The foregoing and other features, aspects and advantages of the presentinvention will become more apparent from the following detaileddescription of the present invention when taken in conjunction with theaccompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing a configuration of an input device inan embodiment of the present invention, together with a control unit ofa digital still camera.

FIG. 2 shows an example of scan pulses.

FIG. 3 shows an example of the relation between the processes executedby the digital still camera, the states of the digital still camera, andinterrupt terminals.

FIG. 4 is a flowchart showing an exemplary flow of a pulse generationprocess executed by a scan pulse output portion.

FIG. 5 is a flowchart showing an exemplary flow of a key detectionprocess executed by a key input detection portion.

FIG. 6 is a diagram showing an exemplary input device in a modifiedembodiment.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

In the following, an embodiment of the present invention will bedescribed with reference to the figures. In the following description,the same parts are denoted with the same reference numerals. Their namesand functions are also the same. Therefore, a detailed descriptionthereof will not be repeated.

An input device in the present embodiment is applied as a user interfaceof electronic equipment. Here, the input device is applied to a digitalstill camera as an example of electronic equipment, by way of example. Adigital still camera, which is well known and of which description isnot repeated here, changes between an image pickup state in which animage is picked up and a replay state in which the picked-up image isdisplayed, in accordance with the user's operation. In each state, aplurality of predetermined processes are executed. The processes in theimage pickup state include, for example, an exposure-controllingprocess, an automatic focusing process, and image processing ofcorrecting the picked-up image. The processes in the replay stateinclude, for example, a process of deleting or editing the stored imageand a process of continuously replaying images.

FIG. 1 is a block diagram showing a configuration of an input device 11in the present embodiment, together with a control unit of a digitalstill camera. Referring to FIG. 1, input device 11 includes a scan pulseoutput portion 21, a key switch circuit 31, a key input detectionportion 41, and a register circuit 51. A control unit 61 is a deviceexternal to input device 11.

Scan pulse output portion 21 includes an encoder 23 and a scan pulsegeneration portion 25. Encoder 23 receives, from a state notificationportion 73 of control unit 61 as described later, a state set in thedigital still camera, in other words, a state signal indicating a statein which control unit 61 operates. This state signal is input once everytime the digital still camera has its state changed. Encoder 23 outputs,to scan pulse generation portion 25, code data predetermined for a stateinput from state notification portion 73. In other words, encoder 23stores a table in which code data is associated with each of a pluralityof states, and outputs the code data corresponding to the input state toscan pulse generation portion 25.

The number of bits of code data is not specifically limited and is setin accordance with the number of states that can be switched by thedigital still camera. Here, the digital still camera may assume twostates, namely, the image pickup state and the replay state. So, codedata having a data length of one bit will suffice, wherein the code datacorresponding to the image pickup state is “0” and the code datacorresponding to the replay state is “1.”

Scan pulse generation portion 25 generates scan pulses (pulse signal)including code data received from encoder 23. Scan pulse generationportion 25 selects one of four output terminals O1, O2, O3, O4 connectedwith four output lines LC1, LC2, LC3, LC4, in order, and outputs scanpulses to the selected output terminal for a first prescribed period oftime T1. Scan pulse generation portion 25 outputs scan pulses generatedat intervals of a second prescribed time (T2) to the selected one of thefour output terminals O1, O2, O3, O4 for a prescribed period of time(T1). Specifically, scan pulse generation portion 25 outputs scan pulsesto the selected one of the four output terminals O1, O2, O3, O4 atintervals of time period T2 for period T1 and keeps, of the four outputterminals O1, O2, O3, O4, the other three terminals to which no scanpulse is output, at a High state. Here, T1>T2. For example, givenT1=10×T2, for period T1, ten scan pulses are output to output terminalO1 and High is output to the other output terminals O2, O3, O4. For thenext period T1, ten scan pulses are output to output terminal O2 andHigh is output to the other output terminals O1, O3, O4. Furthermore,for the next period T1, ten scan pulses are output to output terminal O3and High is output to the other output terminals O1, O2, O4. Stillfurther, for the next period T1, ten scan pulses are output to outputterminal O4 and High is output to the other output terminals O1, O2, O3.

Scan pulse generation portion 25 repeats the process of outputting scanpulses to each of the four output terminals O1, O2, O3, O4, in order,for period T1 until the next code data is input from encoder 23. Thescan pulse is a pulse signal having a combination of a High state and aLow state in a predetermined period.

FIG. 2 shows an example of the scan pulses. Referring to FIG. 2, thescan pulses include a start bit (Low) of one bit, code data of N bits (Nis a positive integer), and a stop bit (Low) of one bit.

Returning to FIG. 1, key input detection portion 41 includes four inputterminals I1, I2, I3, I4. The four input terminals I1, I2, I3, I4 areconnected with input lines LR1, LR2, LR3, LR4, respectively. Thepotential of input lines LR1, LR2, LR3, LR4 is set High by a pull-upresistor. Key switch circuit 31 includes sixteen switches SW11-SW14,SW21-SW24, SW31-SW34, SW41-SW44, which are connected with four outputlines LC1, LC2, LC3, LC4 and four input lines LR1, LR2, LR3, LR4,respectively.

For example, switch SW11 has one end connected to output line LC1 andthe other end connected to input line LR1. Therefore, when switch SW11is pressed by the user, switch SW11 electrically connects output lineLC1 with input line LR1. Switch SW21 has one end connected to outputline LC1 and the other end connected to input line LR2. Therefore, whenswitch SW21 is pressed by the user, switch SW21 electrically connectsoutput line LC1 with input line LR2. Switch SW31 has one end connectedto output line LC1 and the other end connected to input line LR3.Therefore, when switch SW31 is pressed by the user, switch SW31electrically connects output line LC1 with input line LR3. Switch SW41has one end connected to output line LC1 and the other end connected toinput line LR4. Therefore, when switch SW41 is pressed by the user,switch SW41 electrically connects output line LC1 with input line LR4.

Key input detection portion 41 is synchronized with scan pulse outputportion 21 and receives, from scan pulse output portion 21, to which ofoutput terminals O1, O2, O3, O4 scan pulses are output. Thus, key inputdetection portion 41 detects that any one of switches SW11, SW21, SW31,SW41 is pressed by the user while it is receiving that scan pulses areoutput from scan pulse output portion 21 to output terminal O1. Keyinput detection portion 41 detects that any one of switches SW12, SW22,SW32, SW42 is pressed by the user while it is receiving that scan pulsesare output from scan pulse output portion 21 to output terminal O2. Keyinput detection portion 41 detects that any one of switches SW13, SW23,SW33, SW43 is pressed by the user while it is receiving that scan pulsesare output from scan pulse output portion 21 to output terminal O3. Keyinput detection portion 41 detects that any one of switches SW14, SW24,SW34, SW44 is pressed by the user while it is receiving that scan pulsesare output from scan pulse output portion 21 to output terminal O4.

Here, a description will be made to an operation of key input detectionportion 41 for period T1 during which scan pulse generation portion 25outputs scan pulses to output terminal O1, by way of example. In a statein which switches SW11, SW21, SW31, SW41 are not pressed by the user,the four input terminals I1, I2, I3, I4 of key input detection portion41 are set High. When switch SW11 is pressed by the user, output lineLC1 is electrically connected with input line LR1 so that scan pulsesare input to input terminal I1 of key input detection portion 41. Upondetecting the scan pulses at input terminal I1, key input detectionportion 41 extracts code data included in the scan pulses and alsodetects that switch SW11 is pressed by the user.

When switch SW21 is pressed by the user, output line LC1 is electricallyconnected with input line LR2 so that scan pulses are input to inputterminal I2 of key input detection portion 41. Upon detecting the scanpulses at input terminal I2, key input detection portion 41 extractscode data included in the scan pulses and also detects that switch SW21is pressed by the user.

When switch SW31 is pressed by the user, output line LC1 is electricallyconnected with input line LR3 so that scan pulses are input to inputterminal I3 of key input detection portion 41. Upon detecting the scanpulses at input terminal I3, key input detection portion 41 extractscode data included in the scan pulses and also detects that switch SW31is pressed by the user.

When switch SW41 is pressed by the user, output line LC1 is electricallyconnected with input line LR4 so that scan pulses are input to inputterminal I4 of key input detection portion 41. Upon detecting the scanpulses at input terminal I4, key input detection portion 41 extractscode data included in the scan pulses and also detects that switch SW41is pressed by the user.

Upon detecting the switch pressed by the user, key input detectionportion 41 updates a switch table stored by register circuit 51. Theswitch table shows whether each of sixteen switches, namely, SW11-SW14,SW21-SW24, SW31-SW34, SW41-SW44, is pressed or not. Specifically, theswitch table has a storage area corresponding to each of switchesSW11-SW14, SW21-SW24, SW31-SW34, SW41-SW44. If the value in the storagearea is “0,” the corresponding switch is not pressed, and if it is “1,”the corresponding switch is pressed. The location of the storage areaspecifies one of switches SW11-SW14, SW21-SW24, SW31-SW34, SW41-SW44,and the value stored in the storage area specifies one of the pressedstate and the not-pressed state.

Key input detection portion 41 further includes two interrupt signaloutput terminals IO1, IO2 for outputting an interrupt signal. Upondetecting that any one of sixteen switches SW11-SW14, SW21-SW24,SW31-SW34, SW41-SW44 is pressed, key input detection portion 41 outputsan interrupt signal to one of interrupt signal output terminals IO1, IO2that is predetermined corresponding to the detected code data. Here,interrupt signal output terminal IO1 is set for code data “0”corresponding to the image pickup state, and interrupt signal outputterminal IO2 is set for code data “1” corresponding to the replay state.When code data “0” is detected, key input detection portion 41 outputsan interrupt signal to interrupt signal output terminal IO1. When codedata “1” is detected, key input detection portion 41 outputs aninterrupt signal to interrupt signal output terminal IO2.

Here, register circuit 51 stores which of sixteen switches SW11-SW14,SW21-SW24, SW31-SW34, SW41-SW44 is pressed. Instead, a predetermined keycode corresponding to the pressed one among the sixteen switchesSW11-SW14, SW21-SW24, SW31-SW34, SW41-SW44 may be output to control unit61. In this case, register circuit 51 is unnecessary.

Control unit 61 is a central processing unit (CPU) which controls thewhole of the digital still camera equipped with input device 11. Controlunit 61 includes a process execution portion 71 for executing a functionof the digital still camera and a state notification portion 73 fornotifying input device 11 of a state of the digital still camera.

Process execution portion 71 is connected with input device 11 andincludes a first port II1 and a second port II2 for receiving aninterrupt signal. Process execution portion 71 receives an interruptsignal at one of first port II1 and second port II2 to read the tablestored in register circuit 51 thereby to determine which of the sixteenswitches SW11-SW14, SW21-SW24, SW31-SW34, SW41-SW44 has been pressed. Aprocess is then executed, which is specified corresponding to the one offirst port II1 and second port II2 that has received the interruptsignal and the one of the sixteen switches SW11-SW14, SW21-SW24,SW31-SW34, SW41-SW44 that has been pressed.

A process to be executed by process execution portion 71 is specifiedcorresponding to each of switches SW11-SW14, SW21-SW24, SW31-SW34,SW41-SW44 depending on a state of the digital still camera. For example,a program executed by control unit 61 includes a subroutine programassociated with a combination of a state of the digital still camera anda switch (operated by the user). Control unit 61 allows the process tobranch, based on the state of the digital still camera and the switchpressed by the user, thereby determining a subroutine program to beexecuted.

FIG. 3 shows the relation between the processes executed by the digitalstill camera, the states of the digital still camera, and the interruptterminals. Referring to FIG. 3, an item of state signal, an item ofinterrupt terminal, and an item of assigned process are included. If aninterrupt signal is input to first port II1 and if pressing a switchcorresponding to a button A is stored in register circuit 51, thenprocess execution portion 71 executes a subroutine program in which afile deletion process is described. If an interrupt signal is input tosecond port II2 and if pressing the switch corresponding to button A isstored in register circuit 51, then process execution portion 71executes a subroutine program in which a process of setting a flash lampis described.

When an interrupt signal is input to one of first port II1 and secondport II2, process execution portion 71 determines a subroutine programto be executed and then executes a process only by referring to registercircuit 51 to determine which switch is pressed. Therefore, it isneither necessary to determine whether the digital still camera is inthe image pickup state or the replay state, nor to execute a checkprocess for such a determination, thereby increasing the processingspeed. The subroutine programs include a program in which a process ofswitching the states of the digital still camera is described. Whenexecuting the process of switching the states of the digital stillcamera, process execution portion 71 outputs a signal to statenotification portion 73 to indicate the state after switching.

State notification portion 73 receives a signal indicating the stateafter switching from process execution portion 71 to output to inputdevice 11 a state signal predetermined for the state after switching.

FIG. 4 is a flowchart illustrating an exemplary flow of a pulsegeneration process executed by the scan pulse output portion. Referringto FIG. 4, scan pulse output portion 21 determines whether a statesignal is input from control portion 61 (step S01). If a state signal isinput, the process proceeds to step S02. If not, the process proceeds tostep S03. It is noted that immediately after the power is turned on, theprocess waits until an initial state signal is input.

In step S02, predetermined code data corresponding to the state signalis determined, and the process then proceeds to step S03. In step S03, avariable i is set to 1. Variable i is a variable for specifying theoutput terminal that outputs scan pulses, among output terminals O1, O2,O3, O4. Here, a sequence O(i) is used, wherein output terminals O1, O2,O3, O4 are associated with sequences O(1), O(2), O(3), O(4),respectively.

In step S04, output terminal O(i) is set as the target of the process ofoutputting scan pulses. If i is set to “1,” output terminal O1 is set asthe process target. If i is set to “2,” output terminal O2 is set as theprocess target. If i is set to “3,” output terminal O3 is set as theprocess target. If i is set to “4,” output terminal O4 is set as theprocess target.

Then, scan pulses are output to the one of output terminals O1-O4 thatis set as the process target (step S05). The scan pulses include a Lowstart bit, code data bits, a Low stop bit. It is then determined whetherprescribed time T2 has passed since the scan pulse was output (stepS06). The prescribed time has a predetermined value set as a scan pulsetransmission interval. It may be set depending on the transfer rate ofthe scan pulses and the bit length of the scan pulses. The process waitsuntil prescribed time T2 has passed. If prescribed time T2 has passed,the process proceeds to step S07.

In step S07, it is determined whether prescribed time T1 has passedsince the initial scan pulse was output. If prescribed time T1 haspassed, the process proceeds to step S08. If not, the process returns tostep S05. Prescribed time T1 is a predetermined period of time duringwhich the scan pulses are continuously output to the one of outputterminals O1-O4 that is set as the process target. The number of times ascan pulse is output to the one of output terminals O1-O4 that is set asthe process target may be counted, so that the scan pulses are outputuntil the count value reaches a predetermined number of times.

In step S08, it is determined whether variable i is equal to “4.” Ifvariable i is equal to “4,” the process returns to step S03. If not, theprocess proceeds to step S09. In step S09, variable i is set to a valueincremented by one, and the process returns to step S04. This is tochange the process target among output terminals O1-O4.

FIG. 5 is a flowchart showing an exemplary flow of a key detectionprocess executed by the key input detection portion. Referring to FIG.5, key input detection portion 41 sets variable i to “0” (step S11).Variable i is a counter for counting the number of times a start bit ofscan pulse is detected.

In step S12, it is determined whether a start bit is detected at one ofinput terminals I1, I2, I3, I4. Here, it is determined whether a one-bitLow signal is detected or not. The process waits until a start bit isdetected at any one of input terminals I1, I2, I3, I4. If a start bit isdetected at any one of input terminals I1, I2, I3, I4, the processproceeds to step S13.

In step S13, it is determined whether variable i is equal to a thresholdvalue T. If variable i is equal to threshold value T, the processproceeds to step S15. If not, the process proceeds to step S14. In stepS14, variable i is set to the value incremented by one, and the processthen returns to step S12. To distinguish the scan pulse from chattering,the scan pulse is identified by detecting a start bit T times. Here,T=4.

In step S15, code data is taken in. The code data is taken in byanalyzing the scan pulses input following the start bit. Furthermore, itis determined whether a stop bit is detected following the code data(step S16). Here, it is determined whether a one-bit Low signal isdetected following the code data. If a stop bit is detected, the processproceeds to step S17. If not, the process returns to step S11. If nostop bit is detected, the start bit and the taken-in code data that havebeen detected until then are handled as chattering. A detection error isthus prevented. It is noted that the scan pulses may be configured onlywith a start bit and code data without using a stop bit.

In step S17, the one of input terminals I1, I2, I3, I4 at which thestart bit is detected in step S12 is specified. Then, based on thespecified input terminal, a switch is specified (step S18).Specifically, a switch is specified based on, among output terminals O1,O2, O3, O4, the output terminal that outputs the scan pulse at the timeof detection of the start bit in step S12 in the above-mentioned pulsegeneration process, and the input terminal specified in step S17.

In step S19, it is set in the register circuit that the specified switchis pressed. In the next step S20, a predetermined state for the codedata taken in in step S15 is determined. Here, code data “0” correspondsto the image pickup state and code data “1” corresponds to the replaystate.

Then, of interrupt signal output terminals IO1, IO2, the one that ispredetermined for the determined state is determined. Here, interruptsignal output terminal IO1 corresponds to the image pickup state, andinterrupt signal output terminal IO2 corresponds to the replay state. Instep S22, an interrupt signal is output to the one of interrupt signaloutput terminals IO1, IO2 that is determined in step S21. The processthen ends.

<Modification>

FIG. 6 is a diagram showing an exemplary input device in a modifiedembodiment. Referring to FIG. 6, an input device 11A in a modifiedembodiment differs from input device 11 shown in FIG. 1 in that encoder23 and register circuit 51 are replaced by an encoder 23A and a registercircuit 51A, respectively. Input device 11 shown in FIG. 1 receives astate signal from control unit 61, whereas encoder 23A of input device11A in the modified embodiment detects a connection state of a lens 81,a flash lamp 83, a memory card 85, and a charger 87 mounted on thedigital still camera and detects a state depending on a combination ofthe connected lens 81, flash lamp 83, memory card 85, and charger 87.Lens 81, flash lamp 83, memory card 85, and charger 87 mounted on thedigital still camera are devices external to input device 11A.

Encoder 23A specifies a combination of the connected devices (connectionstate) by detecting which of lens 81, flash lamp 83, memory card 85, andcharger 87 is connected to the digital still camera. Encoder 23Aoutputs, to scan pulse generation portion 25, code data predeterminedfor the specified combination. In other words, encoder 23A stores atable in which a plurality of combinations are each associated with codedata, and encoder 23A outputs the code data corresponding to thespecified combination to scan pulse generation portion 25. Here, sincethere are six combinations in which lens 81, flash lamp 83, memory card85, and charger 87 are connected, code data having a data length of fourbits will suffice.

Register circuit 51A stores switch tables corresponding to therespective connection states of lens 81, flash lamp 83, memory card 85,and charger 87. Specifically, six switch tables are stored correspondingto the respective six connection states. Key input detection portion 41specifies a switch table corresponding to the code data, from the sixswitch tables, and overwrites the corresponding storage area of thespecified switch table. The corresponding storage area is the storagearea allocated to the pressed switch among switches SW11-SW14,SW21-SW24, SW31-SW34, SW41-SW44.

It is noted that register circuit 51A in the modified embodiment may beapplied to the above-noted input device 11. Conversely, register circuit51 of the above-noted input device 11 may be applied to input device 11Ain the modified embodiment. In this case, six interrupt signal outputterminals are required corresponding to the six connection states.

In the present embodiment, scan pulse generation portion 25 selects oneof the four output terminals O1, O2, O3, O4 in order and outputs aplurality of scan pulses to the selected output terminal for aprescribed period of time T1.

Alternatively, one scan pulse may be output to the four output terminalsO1, O2, O3, O4, in order. Specifically, one scan pulse is output once tooutput terminal O1, thereafter one scan pulse is output once to outputterminal O2, then one scan pulse is output once to output terminal O3,and then one scan pulse is output once to output terminal O4. In thiscase, key input detection portion 41 identifies the scan pulse oncondition that a start bit is detected successively T times at each ofthe four input terminals I1, I2, I3, I4, similarly as described above.

Although the present invention has been described and illustrated indetail, it is clearly understood that the same is by way of illustrationand example only and is not to be taken by way of limitation, the spiritand scope of the present invention being limited only by the terms ofthe appended claims.

1. An input device comprising: a state detection portion to detect astate of a connected external device; a signal generation portion togenerate a pulse signal predetermined for said detected state; a signaldetection portion responsive to detection of a pulse signal to output astate signal predetermined for the detected pulse signal; and anopening/closing portion to open/close a circuit that connects saidsignal generation portion with said signal detection portion.
 2. Theinput device according to claim 1, wherein said state detection portionincludes a state signal accepting portion to accept said state signaloutput by said external device.
 3. The input device according to claim1, wherein said state detection portion includes a connection detectionportion to detect that one or more external devices are connected;wherein among a plurality of states predetermined corresponding to aplurality of combinations in which said one or more external devices areconnected, said state detection portion detects a state corresponding toa combination of said one or more external devices detected as beingconnected by said connection detection portion is detected.
 4. The inputdevice according to claim 1, wherein said signal generation portion isconnected to said signal detection portion through a plurality ofcircuits, and in order to output a pulse signal to any one of saidplurality of circuits, selects one of said plurality of circuits inorder and outputs a pulse signal to the selected one of said pluralityof circuits for a prescribed period, a plurality of said opening/closingportions are respectively provided for said plurality of circuits, andsaid signal detection portion outputs, in addition to said state signal,identification information for identifying one of said plurality ofopening/closing portions that is provided for a circuit that receives apulse signal from said signal generation portion when said signaldetection portion detects the pulse signal.